<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DoitPHP权限控件-DEMO</title>
<style type="text/css">
<!--
body {
	margin: 0px;
	padding: 0px;
	background-color: #FFF;
	text-align: center;
}
.total {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	line-height: 25px;
	color: #000;
	height: auto;
	width: 750px;
	padding: 0px;
	text-align: left;
	margin-top: 30px;
	margin-right: auto;
	margin-bottom: 0px;
	margin-left: auto;
	border: 1px solid #AACCEE;
}
.check_list {
	height: 15px;
	width: 15px;
}
-->
</style>
<?php echo script::add('jquery'); ?>
<?php echo script::add('checkbox'); ?>
<script type="text/javascript">
$(document).ready(function(){$('#select_all_button').checkbox_all('.list_id');$('#select_none_button').checkbox_none('.list_id');$('#select_anti_button').checkbox_anti('.list_id');$('#submit_config_button').click(function(){var list_id=$.checkbox_get_id('.list_id');$.post('<?php echo $this->create_url('index/ajax_handle_config_role'); ?>', {role_id:'<?php echo $role_id; ?>',list_id:list_id}, function(data){if(data==101){alert('操作成功！');location.reload();}else{alert(data);}});});});
</script>
</head>

<body>
<div class="total">
<table width="750" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="60" align="center">DoitPHP权限控制(DEMO版)</td>
  </tr>
  <tr>
    <td height="30"><table width="750" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="10" height="30" bgcolor="#D3DFEE">&nbsp;</td>
        <td width="150" align="center" bgcolor="#D3DFEE"><a href="<?php echo $this->create_url('index/index', array('mode'=>1, 'page'=>$page), false); ?>">操作(option)管理</a></td>
        <td width="150" align="center" bgcolor="#FFFFFF">角色（role）管理</td>
        <td width="150" align="center" bgcolor="#D3DFEE"><a href="<?php echo $this->create_url('index/index', array('mode'=>3, 'page'=>$page), false); ?>">用户(user)管理</a></td>
        <td width="290" bgcolor="#D3DFEE">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="360" align="left" valign="top"><table width="750" border="0" cellspacing="0" cellpadding="0">      
      <tr>
        <td height="40" align="right"><a href="<?php echo $this->create_url('index/index', array('mode'=>2), false); ?>" target="_self">返回角色管理列表</a>&nbsp;&nbsp;</td>
      </tr>
      <tr>
        <td height="60"><table width="750" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="190" height="30">&nbsp;</td>
            <td width="60" align="center">角色：</td>
            <td width="500" align="left" style="color:#C00;"><?php echo $role_data['role_name']; ?></td>
          </tr>
          <tr>
            <td width="130" height="30">&nbsp;</td>
            <td width="60" align="center">说明：</td>
            <td align="left"><?php echo $role_data['role_description']; ?></td>
          </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td height="15"></td>
      </tr>
      <tr>
        <td><table width="750" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="30" height="30">&nbsp;</td>
            <td colspan="2" align="left">&nbsp;<input type="button" name="select_all" id="select_all_button" value="全选"/>&nbsp;<input type="button" name="select_none" id="select_none_button" value="全不选" />&nbsp;<input type="button" name="select_anti" id="select_anti_button" value="反选"/></td>
            </tr>
<?php foreach((array)$list_data as $lines) {?>            
          <tr>
            <td width="30" height="30">&nbsp;</td>
            <td width="30" align="center"><input name="checkbox" type="checkbox" class="list_id" value="<?php echo $lines['auth_option_id']; ?>" <?php if(in_array($lines['auth_option_id'], $selected_array)){ echo 'checked="checked"'; } ?>/></td>
            <td width="690" align="left"><?php echo $lines['auth_option_name']; ?></td>
          </tr>
<?php } ?>          
          <tr>
          	<td width="30" height="30" align="center">&nbsp;</td>            
            <td height="30" align="left">&nbsp;</td>
            <td height="30" align="left"><input type="button" name="submit_config" id="submit_config_button" value="设置" /></td>            
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</div>
</body>
</html>